package com.smmisia.shop.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum SubscribeEnum {

    //0随时可退,1审核
    CAN_REFUND(0, "随时可退"),
    NEED_CHECK(1, "审核");

    @EnumValue
    private Integer code;
    private String desc;

    SubscribeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubscribeEnum getSubscribeEnum(Integer code) {
        for (SubscribeEnum subscribeEnum : SubscribeEnum.values()) {
            if (subscribeEnum.getCode().equals(code)) {
                return subscribeEnum;
            }
        }
        return null;
    }
}
